import java.math.BigInteger;
import java.util.Scanner;

public class FCTRL2 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int t = s.nextInt();
		while (t-- > 0) {
			int n = s.nextInt();
			BigInteger fact = new BigInteger("1");
			for (int i = 1; i <= n; i++) {
				fact = fact.multiply(new BigInteger(String.valueOf(i)));
			}
			System.out.println(fact);
		}
		s.close();
	}
}
